package com.teach.javafxclient;

import com.teach.javafxclient.controller.base.*;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import kong.unirest.json.JSONArray;

import java.io.IOException;

public class HelloFXApp extends Application {
    public static void main(String[] args) {
        // Launch the JavaFX application
        launch(args);
    }
    @Override
    public void start(Stage stage) throws IOException {
//        stage.setTitle("Hello JavaFX Application");
//        FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("base/course-table.fxml"));
//        Globalvar.userToken = "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMDI0OTk5OSIsImlhdCI6MTcxNjEyMTA4MywiZXhwIjoxNzE2MTI5NzIzfQ.Uv6d_jy4EyaM4RGijch7wT5L7go_Rl2nEvVHFLvE8IWhZlMn7PUEuSz43xGaLaN5iTEe7KLw7Zm3f6BoMvj3sQ";
//         Parent root = fxmlLoader.load();
//        CourseTableController CTC = fxmlLoader.getController();
//        JSONArray jsonArray = new JSONArray();
//        JSONArray innerArray1 = new JSONArray();
//        innerArray1.put(1);
//        innerArray1.put(2);
//        JSONArray innerArray2 = new JSONArray();
//        innerArray2.put(7);
//        innerArray2.put(2);
//        jsonArray.put(innerArray1);
//        jsonArray.put(innerArray2);
//        CTC.set(jsonArray);
//        Scene scene = new Scene(root, 600.0, 506.0);
//        stage.setScene(scene);
//        stage.show();
        FXMLLoader fxmlLoader = new FXMLLoader(HelloFXApp.class.getResource("base/course-register.fxml"));



        Scene scene = new Scene(fxmlLoader.load(), 600.0, 600.0);
        stage.setTitle("课程注册");
        stage.setScene(scene);
        stage.show();
    }
}